package com.easy.stock.dao;

import org.jongo.MongoCollection;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 所有数据访问层的基础类
 * 
 * @author simonlin
 */
public class BaseDao {
	
	private String dbName;
	private String collectionName;
	
	@Autowired
	private MongoDataSource mongoDataSource;
	
	public MongoCollection getCollection() {
		return mongoDataSource.getCollection(dbName, collectionName);
	}
	
	public void setDbName(String dbName) {
		this.dbName = dbName;
	}
	public void setCollectionName(String collectionName) {
		this.collectionName = collectionName;
	}
	
}
